package com.wxl.multi.redis;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);

//        RedisTemplate cluster1RedisTemplate = run.getBean("cluster1RedisTemplate", RedisTemplate.class);
//        RedisTemplate cluster2RedisTemplate = run.getBean("cluster2RedisTemplate", RedisTemplate.class);
//
//        Object val1 = cluster1RedisTemplate.opsForValue().get("wxl");
//        System.out.println(val1);
//
//        Object val2 = cluster2RedisTemplate.opsForValue().get("wxl");
//        System.out.println(val2);

        TestController testController = run.getBean("testController", TestController.class);
        testController.test("wxl");
    }
}
